#include "../comm.h"
class Solution {
public:
    vector<int> findPeaks(vector<int>& mountain) {
        vector<int> ans;
        if(mountain.size() <= 2) return {};
        bool up = mountain[1] > mountain[0];
        for(int i = 2; i < mountain.size(); ++i)
        {
            if(mountain[i] < mountain[i - 1])
            {
                if(up) ans.push_back(i - 1);
                up = false;
            }
            else if(mountain[i] > mountain[i - 1])
                up = true;
            else
                up = false;
        }
        return ans;
    }
};